package demo2;

import javax.xml.bind.DataBindingException;

public class TestDemo2 {
    public static void main(String[] args) {
        System.out.println("before");
        try {
            System.out.println(10 / 0);
            System.out.println("eeee");//不会打印
        } catch (ArithmeticException | DataBindingException e) {//可以捕获多个异常
            e.printStackTrace();//它的打印不是通过 System.out.println 来打印
            System.out.println("111111");
        } catch (Exception e) {//不可 Exception 在前面，但是它可以在后面起到垫背的作用
            System.out.println("12222");
        }
        System.out.println("after");
    }
    public static void main1(String[] args) {
//        int a = 1;
//        if(a == 1) {
//            throw new RuntimeException("awdoawhdiaw");
//        }
        System.out.println("before");
        try {
            System.out.println(10 / 0);
            System.out.println("eeee");//不会打印
        } catch (ArithmeticException | DataBindingException e) {//可以捕获多个异常,但是不建议这么写
            e.printStackTrace();//它的打印不是通过 System.out.println 来打印
            System.out.println("111111");
        }
        System.out.println("after");
    }


    public static void main0(String[] args) throws CloneNotSupportedException {
        Per per = new Per("xiaoming");
        Per per1 =(Per) per.clone();
        int a = 1;
    }
}

class Per implements Cloneable {
    public String name;

    public Per(String name) {
        this.name = name;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
